from launch import LaunchDescription
from launch_ros.actions import Node
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import PathJoinSubstitution
from launch_ros.substitutions import FindPackageShare


def generate_launch_description():
    """
    Launch the inner loop controller and plot the runtime, with input from js
    """

    plot = Node(
        package="toolbox",
        executable="plot_runtime",
        name="plot_runtime",
        output="screen",
        parameters=[
            {
                "topics": "torque,rotate_torque,target_angle,angle,target_gyro,gyro,target_gyroz,gyroz,target_speed,speed"
            },
            {"auto_start": True},
        ],
    )

    return LaunchDescription([plot])
